<script>
    let arr = [19,3,9,90,1,32,20]
    Array.prototype.selectionSort = function () {
        for(let i = 0; i < this.length -1; i++){
            let minIndex = i
            for(let j = i; j < this.length; j++){
                if(this[j]<this[minIndex]){
                    minIndex = j
                }
                if(i != minIndex){
                    let temp = this[i]
                    this[i] = this[minIndex]
                    this[minIndex] = temp
                }
            }
        }
    }
    arr.selectionSort()
    console.log(arr);
</script>